package com.csun.cmny.provider.task;

import com.csun.cmny.provider.config.RedisInitRunner;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import javax.annotation.Resource;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-04-18 20:44
 * @Description:
 */
@Slf4j
public class RedisRefreshQuartz extends QuartzJobBean {

    @Resource
    private RedisInitRunner redisInitRunner;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        try {
            redisInitRunner.run(new String[]{});
            log.info("=====>  redis init runner run");
        } catch (Exception e) {
            log.error("=====>  redis init runner run error: {}", e.getMessage());
        }
    }
}
